define('pc/js/mod/ucenter/vue-account-credit', [
    'utils/fetchEnhancer'], (fetch) => {

const VueAccountCredit = {
    props: ['strUid'],
    data: function() {
        return {
            credit: null
        }
    },
    methods: {
        fetchData: function() {
            fetch('/api/account/getcredit').then((res) => {
                if(0 === res.status) {
                    this.credit = res.data.data;
                }
            });
        }
    },
    mounted: function() {
        this.fetchData();
    },
    template:
`<div>
    <h2 class="uc-itemtitle">我的财富</h2>
    <div class="uc-content-wrapper">
        <table class="x-table">
            <tr><td>余额</td><td>积分</td><td>经验值</td></tr>
            <tr>
                <td>{{ credit ? credit.money : '' }}</td>
                <td>{{ credit ? credit.score : '' }}</td>
                <td>{{ credit ? credit.experience : '' }}</td>
            </tr>
        </table>
    </div>
</div>`
};

return VueAccountCredit;

});
